<div class="content">

	<?php
	$tools = array();
	echo n_mod('skin')->pageHead("我的站点",$tools)
	?>
	<div class="n-sep">
	<table class="n-table n-size-full">
		<thead>
			<tr>
				<td colspan="10">
					<div class="n-right">
						<form>
							<input class="n-search" tips="scode" type="text" name="code" value="<?=empty($data['code'])?'':$data['code']?>" />
							<input type="submit" />
						</form>
					</div>
				</td>
			</tr>
		</thead>
		<tbody>
			
		<tr>
			<th width="50">ID</th>
			<th width="100">SCODE/名字</th>
			<th width="200">地址</th>
			<th>开通服务</th>
			<th>操作</th>
		</tr>
		
	<?php
	if(!empty($data['data'])){
		$pbox = n_api("pbox");
		$rbac = n_api("rbac");
		$member = n_api("member");
		$spackage = n_api('spackage');
		$passport = n_api("passport");
		foreach($data['data'] as $key=>$val){
			
			$spaInfo = $spackage->getSiteServicesMenu($val['scode'],true);
	?>
		<tr>
			<td><?=$val['id']?></td>
			<td><?=$val['scode']?><br /><?=$val['name']?></td>
			<td><?=$val['url']?></td>
			<td>
				<?php
				if(!empty($spaInfo)){
				?>
					<?php
					foreach($spaInfo as $key1=>$val1){
						if($val1['pevent']=='kwdgrep'){
							if ($_SESSION['ppid'] == 1) {
					?>
					<a class="n-href" style="display: inline-block;" href="<?=n_url($val1['pevent'],'siteIndex',array('scode'=>$val['scode']))?>">
						<span><?=$val1['name']?></span>
					</a>
					<?php
							}
						}else{
					?>
					<a class="n-href" style="display: inline-block;" href="<?=n_url($val1['pevent'],'siteIndex',array('scode'=>$val['scode']))?>">
						<span><?=$val1['name']?></span>
					</a>
					<?php		
						}
					}
					?>
				<?php
				}else{
				?>
				未开通任何服务
				<?php
				}
				?>
				<a class="n-href" style="display: inline-block;" href="<?=n_url('antidata','siteIndex',array('scode'=>$val['scode']))?>"><span>数据中心</span></a>
				<a class="n-href" style="display: inline-block;" href="<?=n_url('lookback','index',array('scode'=>$val['scode']))?>"><span>功能回查</span></a>
				<a class="n-href" style="display: inline-block;" href="<?=n_url('ignore','siteIndex',array('scode'=>$val['scode']))?>"><span>替换内容</span></a>
			</td>
			<td>
				<a class="n-href" href="<?=$val['url']?>" target="_blank"><span>访问</span></a>
				<?php
				if('Y'==$val['isdel']){
				?>
				<?=n_ui(n_url('nsite','doundel',array('id'=>$val['id'])),'恢复')?>
				<?php
				}else{
				?>
				<?=n_href(n_url('spackage','siteIndex',array('scode'=>$val['scode'])),'服务设置')?>
				<?php
				if($_SESSION['ppid'] < 6){
				?>
				<?=n_ui(n_url('nsite','edit',array('id'=>$val['id'])),'修改')?>
				<?=n_ui(n_url('nsite','init',array('scode'=>$val['scode'])),'数据初始化')?>
				<?=n_ui(n_url('nsite','dodel',array('id'=>$val['id'])),'删除')?>
				<?php
				}
				?>
				<?=n_href(n_url('antidata','edit',array('scode'=>$val['scode'])),'测试')?>
				<?=n_href(n_url('mergestat','siteIndex',array('scode'=>$val['scode'])),'统计')?>
				<?php
				}
				?>
			</td>
		</tr>
	

	<?php
		}
	?>
		</tbody>
	</table>
	<div class="n-paging"><?=$data['paging']?></div>
	</div>
	<?php
	}else{
	?>
		<tr>
			<td colspan="10">暂无数据</td>
		</tr>
		</tbody>
	</table>
	<?php
	}
	?>
		
</div>